package ntd.util.frame.javacv.ai_fuming;

import cn.hutool.core.io.FileUtil;
import cn.hutool.cron.CronUtil;
import ntd.tool.ToolCron;
import ntd.util.frame.javacv.config.AiConfig;
import ntd.util.util.ToolDuration;

public class AiFileClear {

    public static void main(String[] args) {
        // AI 分析结果空文件夹清理任务
        CronUtil.schedule("0 30 * * * *", (Runnable) AiFileClear::clearLocalEmptyFile);

        ToolCron.initTask();
    }

    public static void clearLocalEmptyFile() {
        ToolDuration.duration(() -> {
            FileUtil.cleanEmpty(FileUtil.mkdir(AiConfig.LOCAL_BASE_DATA_PATH + "/"));
        }, "本地空文件清理任务");
    }
}
